<template >
<d-Modal  :show.sync="show">
  <span slot="header">Edit</span>
  <div slot="body">
    <d-form :edit-form-data='editFormData' :form-type='formType' :form-info-set-id='formInfoSetId' :form-cancel-fun='formCancelFun' :form-submit-fun='formSubmitFun' :form-edit-extra-data ='formEditExtraData'></d-form>
  </div>
  <div slot="footer">
  </div>
</d-Modal>
</template>
<script>
  import dModal from './Modal.vue'
  import dForm from './Form.vue'
    export default{
      components:{
        dModal,
        dForm
      },
      ready:function () {
        this.$watch('show',function (value) {
          if(value){
            this.$nextTick(function(){
             this.init();
            })
          }
        });
      },
      watch:{
        'show':function(value){
          if(value){
             this.init();
          }
        }
      },
      data:function () {
        return{

        }
      },
      vuex:{
        actions:{

        }
      },
      methods: {
        init:function () {

        }
      },
      props:{
        show:{
          type:Boolean,
          default:false
        },
        editFormData:{
          type:Object,
        },
        formType:{
          type:String,
        },
        formInfoSetId:{
          type:String,
        },
        formCancelFun:{
          type:Function
        },
        formSubmitFun:{
          type:Function
        },
        formEditExtraData:{
          type:Object
        }
      }
    }
</script>
<style rel="stylesheet/scss" type="text/css" lang="scss" scoped>
  @import "../../assets/css/variable";
  .form {
    padding: 20px;
    margin: 0 auto;
    min-height: 150px;
    .msg-wrap{
      position: fixed;
      margin-top:6px;
    }
    .input_line{
      /*height: 40px;*/
      line-height: 38px;
      float: left;
      .input_line_left{
        width: 160px;
        text-align: right;
        float: left;
        padding: 0 10px;
        .label{
          text-align: right;
          padding-right: 20px;
          position: relative;
          display: inline-block;
          width: 100%;
          box-sizing: border-box;
          overflow: hidden;
          white-space: nowrap;
          text-overflow: ellipsis;
          vertical-align: middle;
          font-weight: bold;
          &.isMust:after{
            content: '*';
            color: #ff5500;
            position: absolute;
            right: 2px;
            top: 6px;
            font-size: 22px;
          }
        }
      }
      .input_line_right{
        width: 200px;
        text-align: left;
        float: left;
        .input{
          width: 170px;
          box-sizing: border-box;
          padding: 0 12px;
          color: #666;
        }
        .textarea{
          width: 170px;
          height: 60px;
        }
      }
    }
    .btn_group{
      margin-top: 40px;
      button{
        margin: 0 12px;
      }
      text-align: center;
    }
  }
</style>
